FROM python:3.7-buster

WORKDIR /code
RUN pip config set global.index-url https://repo.nju.edu.cn/repository/pypi/simple
RUN pip install --no-cache-dir flask 
RUN pip install --no-cache-dir flask-restful flask-cors
RUN pip install --no-cache-dir matplotlib
RUN pip install --no-cache-dir wordcloud
RUN pip install --no-cache-dir pymongo==4.1.1
RUN sed -i 's/deb.debian.org/mirror.nju.edu.cn/g' /etc/apt/sources.list
RUN sed -i 's/security.debian.org/mirror.nju.edu.cn/g' /etc/apt/sources.list

RUN apt-get update -y && apt-get install curl -y && rm -rf /var/lib/apt/lists/*
COPY simhei.ttf /code/
ADD docker-entrypoint.sh /code/
ADD main.py /code/
RUN mkdir /code/storage/
EXPOSE 8000
EXPOSE 5000
ENTRYPOINT [ "/code/docker-entrypoint.sh" ]

